<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>发射站管理</title>
    <meta name="decorator" content="nblank"/>
    <%--<script type="text/javascript">--%>
    <%--$(document).ready(function() {--%>
    <%--$("#name").focus();--%>
    <%--$("#inputForm").validate({--%>
    <%--submitHandler: function(form){--%>
    <%--loading('正在提交，请稍等...');--%>
    <%--form.submit();--%>
    <%--},--%>
    <%--errorContainer: "#messageBox",--%>
    <%--errorPlacement: function(error, element) {--%>
    <%--$("#messageBox").text("输入有误，请先更正。");--%>
    <%--if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){--%>
    <%--error.appendTo(element.parent().parent());--%>
    <%--} else {--%>
    <%--error.insertAfter(element);--%>
    <%--}--%>
    <%--}--%>
    <%--});--%>
    <%--});--%>
    <%--</script>--%>
</head>
<body>
<div class="content container">
    <h2 class="page-title">发射站管理<small> 发射站列表</small></h2>
    <section class="widget widget-tabs widget-table-overflow ">
        <header>
            <ul class="nav nav-tabs">
                <li><a href="${ctx}/biz/station/" >发射站列表</a></li>
                <li class="active"><a href="javascript:void(0)">发射站${not empty param.id?'修改':'添加'}</a></li>
            </ul>
        </header>
        <div class="body tab-content">
            <form:form id="inputForm" modelAttribute="station" action="${ctx}/biz/station/save" method="post"
                       class="form-horizontal">
                <form:hidden path="id"/>

                <form:hidden path="office.id" htmlEscape="false" maxlength="50"/>
                <%--<sys:message content="${message}"/>--%>
                <div class="form-group">
                    <label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 名称:</label>
                    <div class="col-sm-4">
                        <form:input path="name" htmlEscape="false" maxlength="50" class="form-control input-transparent"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-sm-4"><span><span style="color:red;">*</span></span> 站址:</label>
                    <div class="col-sm-4">
                        <form:input path="address" htmlEscape="false" maxlength="50" class="form-control input-transparent"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-sm-4">归属部门:</label>
                    <div class="col-sm-4" style="margin-top:7px;">
                            ${param['office.name']}
                    </div>
                </div>
                <div class="form-group">
                    <label for="station-type" class="control-label col-sm-4">站类型:</label>
                    <div class="col-sm-8">

                        <form:select id="station-type" path="type" data-style="btn-primary" data-width="auto" class="selectpicker" items="${fns:getDictList('station_type')}" itemValue="value" itemLabel="label"  >
                        </form:select>

                    </div>
                </div>

                <div class="form-group">
                    <label for="type2" class="control-label col-sm-4">附加类型:</label>
                    <div class="col-sm-8">
                        <form:select path="type2"  data-style="btn-primary"
                                     data-width="auto"
                                     class="selectpicker"  items="${fns:getDictList('station_e_type')}" itemLabel="label" itemValue="value" >
                        </form:select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-sm-4">功率:</label>
                    <div class="col-sm-4">
                        <div class="input-group col-sm-6" style="padding: 0;">
                            <form:input value="" path="power" maxlength="50"
                                        class="required digits form-control input-transparent"/>
                            <div class="input-group-addon" style="background-color: rgba(5, 5, 5, 0.49);">W</div>
                        </div>
                    </div>
                </div>

                <%--<div class="form-group">--%>
                <%--<label class="control-label col-sm-4">设备组:</label>--%>
                <%--<div class="col-sm-4">--%>
                <%--<div class="input-group col-sm-6">--%>
                <%--<div class="checkbox checkbox-inline">--%>
                <%--<form:checkboxes path="equipmentGroups" items="${equipmentGroups}" itemLabel="name" itemValue="id"/>--%>
                <%--</div>--%>
                <%--</div>--%>
                <%--</div>--%>
                <%--</div>--%>

                <div class="form-actions">
                    <div class="text-align-center">
                        <input id="btnCancel" class="btn btn-default" type="button" style="margin-left: -50px;min-width:100px;" value="返 回" onclick="history.go(-1)"/>
                        <input id="btnSubmit" class="btn btn-primary" style="margin-left:50px;min-width:100px;" type="submit" value="保 存"/>&nbsp;
                    </div>
                </div>
            </form:form>
        </div>
    </section>
</div>
<script type="text/javascript">
    $(function(){
        function pageLoad() {
            $("#name").focus();
            $('form').on('submit', function(e) {
                e.preventDefault();
                $(this).ajaxSubmit({
                    success:function(result){
                        pxTrigDlg("${ctx}/biz/station");
                    }
                });
            });
        }
        pageLoad();
    });
</script>

</body>
</html>